<?php
$this->breadcrumbs=array(
	'Table'=>array('/table'),
	'Order Drink',
);?>
<h1>Order Drink</h1>

<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'tables-form',
	'enableAjaxValidation'=>false,
)); ?>

    <p class="note">Fields with <span class="required">*</span> are required.</p>

	<?php echo $form->errorSummary($model); ?>

	<div class="row">
		<?php echo $form->labelEx($model,'drink_id'); ?>
		<?php echo $form->dropDownList($model,'drink_id',CHtml::listData($drinks,'id','type')); ?>
		<?php echo $form->error($model,'drink_id'); ?>
	</div>
    
    <div class="row">
		<?php echo $form->labelEx($model,'table_id'); ?>
		<select style="width:80px" name="OrdersTables[table_id]" id="OrdersTables_table_id">
            <?php for ($i=1; $i<=$tables; $i++) : ?>
            <option value="<?php echo $i; ?>"><?php echo $i; ?></option>
            <?php endfor; ?>
        </select>        
		<?php echo $form->error($model,'table_id'); ?>
	</div>
    
    <div class="row">
		<?php echo $form->labelEx($model,'number'); ?>
		<?php echo $form->textField($model,'number'); ?>
		<?php echo $form->error($model,'number'); ?>
	</div>

    <div class="row buttons">
		<?php echo CHtml::submitButton('Order'); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->